package com.example.skyline.service;

import com.example.skyline.entity.Address;
import com.example.skyline.mapper.AddressMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AddressService {
    @Autowired
    private AddressMapper addressMapper;

//    查询
    public List<Address> getAddress(Integer id,Integer deviceId){
        return addressMapper.selectAll(id, deviceId);
    }

    public List<Address> getAddress(){
        return addressMapper.selectAll();
    }

//    添加
    public void saveAddress(Address address){
        addressMapper.insert(address);
    }

    public void saveAddress(List<Address>selectAll){
        addressMapper.insert(selectAll);
    }

//    删除
    public void deleteAddress(Integer id){
        addressMapper.delete(id);
    }

//    修改
    public void updateAddress(Address address){
        addressMapper.update(address);
    }



}
